/*
 * @Descripttion:
 * @Author: caijj
 * @Date: 2021-02-05 15:38:41
 * @LastEditors: caijj
 * @LastEditTime: 2021-02-22 15:18:42
 */
import request from '@/utils/request';

/*
  获取部门列表
*/
export const getDepartmentTree = data => request({
  url: '/api/department/getTree',
  method: 'post',
  data: data
});

/*
  获取部门列表
*/
export const getDepartmentList = data => request({
  url: '/api/department/getList',
  method: 'post',
  data: data
});

/* 删除部门 */
export const delDepartment = departmentId => request({
  url: `/api/department/delete/${departmentId}`,
  method: 'delete'
});
/* 增加部门 */
export const addDepartment = data => request({
  url: '/api/department/add',
  method: 'post',
  data: data
});
/* 修改部门 */
export const updateDepartment = data => request({
  url: '/api/department/update',
  method: 'put',
  data: data
});

/*
  获取人员列表
  {
	"department": 0,
	"domain": "",
	"groups": [],
	"name": "",
	"pageNo": 0,
	"pageSize": 0,
	"phone": "",
	"roles": [],
	"userGender": "",
	"userId": 0,
	"userState": ""
} */
export const getDepartmentUser = (data) => request({
  url: '/api/user/get',
  method: 'post',
  data: data
});
